home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 November
/
Macworld (1999-11).dmg
/
Updaters
/
WhiteCap 3.0.4
/
WhiteCap Source.sit
/
WhiteCap Source
/
Common
/
General Tools
/
Clipboard.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1999-07-13
|
868b
|
48 lines
#include "Clipboard.h"
Clipboard Clipboard::sAppClipboard;
Clipboard::Clipboard() :
mFlavorList( cOrderImportant ),
mDataList( cDuplicatesAllowed, cOrderImportant ) {
}
void Clipboard::Clear() {
mDataList.RemoveAll();
mFlavorList.RemoveAll();
}
void Clipboard::Append( UtilStr& inData, long inDataFlavor ) {
Append( inData.getCStr(), inData.length(), inDataFlavor );
}
void Clipboard::Append( void* inData, long inLen, long inDataFlavor ) {
mFlavorList.Add( inDataFlavor );
mDataList.Add( inData, inLen );
}
bool Clipboard::Fetch( long inIndex, long& outDataFlavor ) const {
return mFlavorList.Fetch( inIndex, &outDataFlavor );
}
bool Clipboard::Fetch( long inIndex, UtilStr& outData, long& outDataFlavor ) const {
if ( mFlavorList.Fetch( inIndex, &outDataFlavor ) )
return mDataList.Fetch( inIndex, outData );
else
return false;
}